package com.gzlg.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class ViewCtroller {
    @GetMapping("/index")
    public String index(){
        return "index";
    }
    @GetMapping("/compute")
    public String computeValue(Model model){
        int i;
        int sum=0;
        for (i=1;i<101;i++){
            sum=sum+i;
        }
        System.out.println(sum);
        model.addAttribute("sum",sum);
        return "compute";
    }

}
